<template>
  <el-tooltip :disabled="!content" :content="content" :placement="placement">
    <template slot="content">
      <slot name="content"></slot>
    </template>

    <span class="common-text-ellipsis" :class="['common-text-ellipsis', 'text-ellipsis-' + line, cls]">
      <slot>
        {{ !content && showEmpty ? emptyText : content }}
      </slot>
    </span>
  </el-tooltip>
</template>
<script>
export default {
  name: "TextEllipsis",
  props: {
    showEmpty: {
      type: Boolean,
      default: true,
    },
    emptyText: {
      type: String,
      default: "",
    },
    line: {
      type: String,
      default: "1",
    },
    content: String,
    placement: {
      type: String,
      default: "top",
    },
    cls: {
      type: String,
      default: "",
    },
  },
};
</script>
